package com.jt.demos;

import redis.clients.jedis.Jedis;

public class IdGeneratorDemo01{

 public static Long getId(){
  Jedis jedis=new Jedis("192.168.126.129",6379);
  Long id=jedis.incr("id");
  jedis.close();
  return id;
 }

 public static void main(String[] args){

  for(int i=0;i<10;i++){
   new Thread(){
    public void run(){
     String name=Thread.currentThread().getName();
     System.out.println(name+"->"+IdGeneratorDemo01.getId());

    }
   }.start();
  }


 }
}
